Conversation
|
@launchdarkly/js-sdk-common size report |
|
@launchdarkly/browser size report |
|
@launchdarkly/js-client-sdk-common size report |
|
@launchdarkly/js-client-sdk size report |
| variables?: Record<string, unknown>, | ||
| defaultAiProvider?: SupportedAIProvider, | ||
| ): Promise<Judge | undefined> { | ||
| this._ldClient.track(TRACK_JUDGE_CREATE, context, key, 1); |
There was a problem hiding this comment.
Duplicate usage events for chat creation
Medium Severity
createChat now emits a create-chat usage event and then calls completionConfig, which also emits a completion-config usage event for the same operation. This can double-count usage when consumers use createChat as their primary entrypoint, skewing usage reporting compared to direct completionConfig calls.
Additional Locations (1)
| defaultAiProvider?: SupportedAIProvider, | ||
| ): Promise<Judge | undefined> { | ||
| this._ldClient.track(TRACK_JUDGE_CREATE, context, key, 1); | ||
| this._ldClient.track(TRACK_USAGE_CREATE_JUDGE, context, key, 1); |
There was a problem hiding this comment.
Duplicate usage events for judge creation
Medium Severity
createJudge now emits a create-judge usage event and then calls judgeConfig, which also emits a judge-config usage event. This changes usage semantics and can double-count “judge config usage” for callers that primarily use createJudge.
Additional Locations (1)
| modelName: string; | ||
| providerName: string; | ||
| aiSdkName: string; | ||
| aiSdkVersion: string; |
There was a problem hiding this comment.
SDK info removed from metrics payloads
Medium Severity
getTrackData no longer includes aiSdkName/aiSdkVersion, and the LDAIConfigTracker type was updated accordingly. Any analytics pipeline or downstream consumer that relied on these fields in token/duration/success events will silently lose SDK attribution, even though only a separate $ld:ai:sdk:info event is now emitted.
Additional Locations (1)
There was a problem hiding this comment.
This is intentional and we are making the change while still in pre-release. This is not something downstream consumers should be relying on which is part of the reason for this change.
| aiSdkLanguage, | ||
| }, | ||
| 1, | ||
| ); |
There was a problem hiding this comment.
Constructor tracking can spam events
Medium Severity
The LDAIClientImpl constructor now unconditionally calls track for $ld:ai:sdk:info. If client instances are created per request/job (common in server code), this can generate high-volume duplicate events and unexpected side effects during object creation, increasing telemetry cost and potentially impacting latency.


Note
Medium Risk
Changes analytics event keys/payloads and adds constructor-side tracking, which can affect downstream metrics pipelines and introduce unintended extra
trackcalls, but does not alter core AI/config evaluation logic.Overview
Improves usage reporting for the server AI SDK.
LDAIClientImplnow emits a one-time init event ($ld:ai:sdk:info) on construction with{ aiSdkName, aiSdkVersion, aiSdkLanguage }, and renames the per-method tracking events to a consistent$ld:ai:usage:*scheme forcompletionConfig,agentConfig(s),judgeConfig,createChat, andcreateJudge.SDK name/version were removed from
LDAIConfigTracker’s per-metricgetTrackData()payload (tests updated accordingly), andsdkInfonow includes a newaiSdkLanguageconstant.Written by Cursor Bugbot for commit a765834. This will update automatically on new commits. Configure here.